package com.zjw.designPattern.listener.observer;

import com.fasterxml.jackson.annotation.JsonInclude;
import lombok.*;

/**
 * Created with IDEA
 *
 * @description:
 * @author: xubo
 * @create: 2019-04-19 15:44
 */
@Data
@AllArgsConstructor
@NoArgsConstructor
@Builder
@JsonInclude(JsonInclude.Include.NON_NULL)
public class CommonPushMsg {

    private String msgId;

    private String channel;

    private String userId;

    private String opp;

    private Action action;

    private Object msgBody;

    private boolean isRetry = false;

    @Getter
    public enum Action {
        /**
         *
         */
        INIT(0, "init", "初始化"),
        ADD(1, "add", "新建"),
        UPDATE(2, "update", "修改"),
        DELETE(3, "delete", "删除"),
        QUERY(4, "query"),
        SUMMARY_UPDATE(5, "summary_update"),
        CANCEL_HIGHLIGHT(6, "cancel_highlight"),
        UP(7, "up"),
        SUBMIT_OFFER(8, "submit", "提交意向达成"),
        CANCEL(9, "cancel", "撤销"),
        CANCEL_UNDO(10, "cancel_undo","放弃撤销")
        ;

        Action(int typeNum, String type, String display) {
            this.typeNum = typeNum;
            this.type = type;
            this.display = display;
        }

        Action(int typeNum, String type) {
            this(typeNum, type, "");
        }

        private final int typeNum;
        private final String type;
        private final String display;
    }



}
